<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style  >
        .box1{
            width: 200px;
            height: 200px;
            background-color: #333;
            margin: 20px 0;
            position: relative;
        }
        .box2{
            width: 30px;
            height: 30px;
            background-color: red;
            /*相对定位基于元素本身*/
            /*决定定位基于父元素*/
            position: absolute;
                bottom: 0px;
                right: 0px;
        }
        .box3{
            width: 30px;
            height: 30px;
            background-color: yellow;
        }

    </style>
</head>
<body>
    <div class="box1">
        <div class="box3"></div>
        <div class="box2"></div>
    </div>

</body>
</html>